<?php

namespace Home\Controller;
//use OT\DataDictionary;
use Home\Model\AdModel;

/**
 * 前台首页控制器
 * 主要获取首页聚合数据
 */
class IndexController extends HomeController {

	//系统首页
    public function index()
    {
        # 幻灯片图片
        $slideAdList = D('Ad')->getListByPositionName('RollingBanner');
        $this->assign('slideAdList', $slideAdList);
        # END-幻灯片图片

        #案例模块展示
        //获取目录
        $cateList=M('category')->where(array('stats'=>1,'pid'=>0))->order('create_time desc')->limit(4)->select();
        $this->assign('cateList', $cateList);
        //获取每个分类的6个案例
        $docment = M('document');
        foreach($cateList as $key => $value)
        {
            $docmentList[$key]=$docment->where(array('category_id'=>$value['id']))->field('id,name,title,category_id')->limit(6)->select();
        }
        $this->assign('docmentList', $docmentList);
        #END 案例模块展示

        #服务模块展示
        //M('')->select();
        #END 服务模块展示

        $this->display();
    }
}